<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0%;
            padding: 0%;
        }
        body{
            background: #000;
            overflow: hidden;
            height: 100vh;
        }
        span{
            height: 50px;
            width: 50px;
            border-radius: 50%;
            position:absolute;
            pointer-events: none;
            background: #ffa928;
            box-shadow: 20px 20px 60px #4e59ff,-20px -20px -60px #ffa32b;
            transform: translate(-50%,-50%);
            animation: box 4s linear infinite;
        }
        @keyframes box {
            0%{
                transform: translate(-50%,-50%);
                opacity: 1;
                filter: hue-rotate(0deg);
            }
            100%{
                transform: translate(-50%,-1000%);
                opacity: 0;
                filter: hue-rotate(720deg);
            }
        }
    </style>
</head>
<body>
    <script>
        // js自动生成span
        document.addEventListener("mousemove",function(e){
            var body = document.querySelector("body");
            var span = document.createElement("span");
            var x = e.offsetX;
            var y = e.offsetY;

            span.style.left = x + "px";
            span.style.top=y + "px";
            
            var a =Math.random()*30;
            span.style.width = 20 + a + "px";
            span.style.height=20 + a + "px";
            body.appendChild(span);
            setTimeout(function(){
                span.remove();
            },3000)
        })
    </script>
</body>
</html>